package io;

import java.io.*;

public class TestCopy2 {

    //除了读写中文之外，所有流操作建议使用字节流
    public static void main(String[] args) throws IOException {
        //1.创建流
        Reader reader = new FileReader("d:\\a.txt");
        Writer writer=new FileWriter("d:\\a123.txt",true);

        //2.输入流读  输出流写
        char arr[]=new char[10];
        int length=0;

        while((length=reader.read(arr))!=-1){
            writer.write(arr,0,length);
        }

        //3.关闭流
        reader.close();
        writer.close();
    }
}
